package ningbo.generic;

/**
 * @Author 宁铂
 * @Date 2021/7/27 18:07
 * @Version 1.0
 */
public class demo {
    /** 测试多态 */
    public static void main(String[] args) {
        OOP oop = new test("汪汪");
        oop.eat();
        System.out.println(oop.name);


    }
}

class OOP{
    String name;

    public OOP(String name) {
        System.out.println("含参构造");
        this.name = name;
    }

    public void eat(){
        System.out.println("吃啥都行~~");
    }
}

class test extends OOP{



    public test(String name) {
        super(name);
    }

    int age = 100;

    public void eat(){
        System.out.println("吃肉");
    }

}